<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Traits\WorkerMysqlConnect;

class u_record extends Model
{
    use HasFactory;
    use WorkerMysqlConnect;

    protected $table = 'u_record';

    public static function getUserRecord($uid,$startPage=1,$limit=10)
    {
        return self::query()->where(compact('uid'))
            ->offset(($startPage-1)*$limit)->limit($limit)
            ->orderByDesc('id')->get()->toArray();
    }
}
